<template>
    <div class="app-container">
        <el-table :data="listTableData" style="width: 100%">
            <el-table-column fixed prop="postName" label="报名岗位" />
            <el-table-column prop="batchName" label="考试批次" />
            <el-table-column prop="applicationTime" label="报名时间" width="160" />
            <el-table-column prop="approveStatus" label="审批状态" width="160">
                <template #default="{ row }">
                    <el-tag v-if="row.approveStatus == APPROVE_STATUS.APPROVED" type="success">{{
                        APPROVE_STATUS_NAMES[row.approveStatus]
                    }}</el-tag>
                    <el-tag v-else-if="row.approveStatus == APPROVE_STATUS.REJECTED" type="info">{{
                        APPROVE_STATUS_NAMES[row.approveStatus]
                    }}</el-tag>
                    <el-tag v-else type="warning">{{ APPROVE_STATUS_NAMES[APPROVE_STATUS.PENDING] }}</el-tag>
                </template>
            </el-table-column>
        </el-table>
    </div>
</template>

<script setup>
import { examApproveList } from '@/api/exam/registration.js'
import { APPROVE_STATUS, APPROVE_STATUS_NAMES } from '@/const/exam.js'
import { getToken } from '@/utils/auth.js'

const listTableData = ref([{}])

function listExamApprove() {
    examApproveList().then(res => {
        listTableData.value = res.data
    })
}
listExamApprove()

function StudentJumpToExamPlatform(row) {
    // const url = `${import.meta.env.VITE_APP_EXAM_URL}?batchId=${row.batchId}&t=${getToken()}`
    // window.open(url, 'target');
}
</script>
<style scoped></style>